<template>
  <!-- <div>home</div> -->
  <div id="homePage">
		<div class="header">
			<div class="case">
				<input class="search-input" type="text" placeholder="安全工器具信息检索" v-model="search" />
				<img class="scan" src="../../img/scan.png"/>
			</div>
		</div>
		<div class="total_wrapper">
			<div class="nav-tit" url="">
				<span>工具统计</span>
				<img class="nav-arrow" src="../../img/arrow.png"/>
			</div>
			<div class="total-con">
				<div class="total-tit">
					单位：扬州供电公司—输电检修一班
				</div>
				<div class="total-box">
					<div class="total-item" :class="{'active':active===0}" @click="tabSwitch(0)">
						<div class="total-num">
							12380
						</div>
						<div class="total-type">
							安具
						</div>
						<div class="total-label">
							资产总数
						</div>
					</div>
					<div class="total-item" :class="{'active':active===1}" @click="tabSwitch(1)">
						<div class="total-num">
							0
						</div>
						<div class="total-type">
							试验
						</div>
						<div class="total-label">
							即将到期
						</div>
					</div>
					<div class="total-item" :class="{'active':active===2}" @click="tabSwitch(2)">
						<div class="total-num">
							0
						</div>
						<div class="total-type">
							试验
						</div>
						<div class="total-label">
							已经到期
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="list-wrapper">
			<div class="item" v-for="item in list" :key="item" @click="toList">
				<div class="item-pic">
					<img src="https://via.placeholder.com/100"/>
				</div>
				<div class="item-footer">
					<div class="item-label">
						绝缘手套
					</div>
					<div class="item-num">
						1080
					</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				search: '',
				active: 0,
				list: 30
			}
		},
		methods: {
			tabSwitch(n) {
				this.active = n
			},
			toList() {
				this.$router.push('/toollist')
			}
		}
	}
</script>
<style lang='less'>
#homePage {
.header {
	height: 45px;
	position: fixed;
	z-index: 100;
	padding-top:20px;
	padding-bottom: 15px;
	width: 100%;
	top: 0;
	background: rgb(46,152,148);
}
.case {
	height: 40px;
	width: 90%;
	margin:0 auto;
	position: relative;
}
.search-input {
	height: 100%;
	width: 100%;
	outline: none;
	border: 0;
	background: #fff;
	border-radius: 40px;
	padding-left: 20px;
	display: block;
	box-sizing: border-box;
}
.scan {
	width: 20px;
	height: 20px;
	position: absolute;
	right: 18px;
	top: 13px;
}
.total_wrapper {
	width: 100%;
	margin: auto;
	margin-top:80px;
}
.list-wrapper{
	overflow: hidden;
	width: 95%;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	margin: auto;
	margin-top: 15px;
}
.item {
	width: 112px;
	height: 112px;
	border-radius: 10px;
	background: #FFFFFF;
	margin-bottom:15px;
}
.nav-tit {
	color: #FFFFFF;
	font-size: 18px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 90%;
	margin: auto;
	height: 50px;
	font-size: 22px;
	font-weight: bold;
}
.nav-arrow {
	width: 18px;
	height: 18px;
}
.total-con {
	width: 90%;
	height: 160px;
	border-radius: 15px;
	background: #fff;
	margin: 0 auto;
	padding: 10px;
}
.total-tit {
	margin: 0 0 0 10px;
	font-size: 16px;
	color: #999999;
}
.total-box {
	display: flex;
}
.total-item {
	flex: 1;
	text-align: center;
	padding: 10px 0;
}
.active {
	/* background: rgb(224,240,239); */
	color: rgb(54,155,152);
}
.total-num {
	font-size: 30px;
	font-weight: bold;
}
.total-type {
	font-size: 16px;
	color: #999999;
	margin: 20px 0 0 0;
}
.total-label {
	margin: 5px 0 0 0;
	font-size: 18px;
}
.item-pic {
	width: 80px;
	height: 80px;
	margin: 5px 15px;
}
.item-pic img {
	width: 100%;
	height: 100%;
}
.item-footer {
	display: flex;
	font-size: 12px;
	justify-content: space-between;
	padding: 0 10px;
}
.item-num {
	color: rgb(46,152,148);
}
}
</style>